package com.rc.saas.mini.service.rc;

import com.rc.saas.mini.mapper.rc.RcEnterpriseGainSettingMapper;
import com.rc.saas.mini.model.rc.RcEnterpriseGainSetting;
import com.rc.saas.mini.model.rc.RcEnterpriseGainSettingExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcEnterpriseGainSettingServiceImpl implements RcEnterpriseGainSettingService {
    @Autowired
    private RcEnterpriseGainSettingMapper rcEnterpriseGainSettingMapper;

    @Override
    public RcEnterpriseGainSettingMapper getMapper() {
        return rcEnterpriseGainSettingMapper;
    }

    @Override
    public List<RcEnterpriseGainSetting> listByDefault() {
        RcEnterpriseGainSettingExample example = new RcEnterpriseGainSettingExample();
        example.createCriteria().andStatusEqualTo("0");
        example.setOrderByClause("sort");
        return rcEnterpriseGainSettingMapper.selectByExample(example);
    }

    @Override
    public List<RcEnterpriseGainSetting> listByEnterpriseLevel(String enterpriseLevel) {
        RcEnterpriseGainSettingExample example = new RcEnterpriseGainSettingExample();
        example.createCriteria().andStatusEqualTo("0").andEnterpriseLevelEqualTo(enterpriseLevel);
        example.setOrderByClause("sort");
        return rcEnterpriseGainSettingMapper.selectByExample(example);
    }
}
